﻿using System.Windows;
using System.Windows.Input;
using System.Windows.Media;

namespace Socium.Controls {
	/// <summary>
	/// Interaction logic for ImageButton.xaml
	/// </summary>
	public partial class ImageButton {
		public ImageButton() {
			InitializeComponent();			
		}

		#region Command

		public static readonly DependencyProperty CommandProperty =
			DependencyProperty.Register("Command", typeof (ICommand), typeof (ImageButton),
			                            new PropertyMetadata(default(ICommand)));

		public ICommand Command {
			get { return (ICommand) GetValue(CommandProperty); }
			set { SetValue(CommandProperty, value); }
		}

		#endregion

		#region CommandParameter

		public static readonly DependencyProperty CommandParameterProperty =
			DependencyProperty.Register("CommandParameter", typeof (object), typeof (ImageButton),
			                            new PropertyMetadata(default(object)));

		public object CommandParameter {
			get { return GetValue(CommandParameterProperty); }
			set { SetValue(CommandParameterProperty, value); }
		}

		#endregion

		#region Text

		public static readonly DependencyProperty TextProperty =
			DependencyProperty.Register("Text", typeof (string), typeof (ImageButton), new PropertyMetadata(default(string)));

		public string Text {
			get { return (string) GetValue(TextProperty); }
			set { SetValue(TextProperty, value); }
		}

		#endregion

		#region ImageSource

		public static readonly DependencyProperty ImageSourceProperty =
			DependencyProperty.Register("ImageSource", typeof(ImageSource), typeof(ImageButton),
										new PropertyMetadata(default(ImageSource)));

		public ImageSource ImageSource {
			get { return (ImageSource)GetValue(ImageSourceProperty); }
			set { SetValue(ImageSourceProperty, value); }
		}

		#endregion

		#region ImageWidth

		public static readonly DependencyProperty ImageWidthProperty =
			DependencyProperty.Register("ImageWidth", typeof (double), typeof (ImageButton), new PropertyMetadata(double.NaN));

		public double ImageWidth {
			get { return (double) GetValue(ImageWidthProperty); }
			set { SetValue(ImageWidthProperty, value); }
		}

		#endregion

		#region ImageHeight

		public static readonly DependencyProperty ImageHeightProperty =
			DependencyProperty.Register("ImageHeight", typeof (double), typeof (ImageButton), new PropertyMetadata(double.NaN));

		public double ImageHeight {
			get { return (double) GetValue(ImageHeightProperty); }
			set { SetValue(ImageHeightProperty, value); }
		}

		#endregion

		#region ImageStretch

		public static readonly DependencyProperty ImageStretchProperty =
			DependencyProperty.Register("ImageStretch", typeof (Stretch), typeof (ImageButton),
			                            new PropertyMetadata(Stretch.Uniform));

		public Stretch ImageStretch {
			get { return (Stretch) GetValue(ImageStretchProperty); }
			set { SetValue(ImageStretchProperty, value); }
		}

		#endregion
	}
}
